<template>
  <div>
    <h1>当前num值：{{this.$store.state.num}}</h1>
    <button @click="sub()">num++</button>
  </div>
</template>

<script>
  export default {
    name: 'huohua',
    methods: {
      sub() {
        this.$store.commit('subnum');

      }
    }
  }
</script>

<style>
</style>
